<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN"><html lang="en">
<HEAD>

<meta name="copyright" content="Copyright (c) IBM Corporation and others 2000, 2017. This page is made available under license. For full details see the LEGAL in the documentation book that contains this page." >

<META HTTP-EQUIV="Content-Type" CONTENT="text/html; charset=ISO-8859-1">
<META HTTP-EQUIV="Content-Style-Type" CONTENT="text/css">

<LINK REL="STYLESHEET" HREF="../book.css" CHARSET="ISO-8859-1" TYPE="text/css">
<TITLE>
Text editors and platform text
</TITLE>

<link rel="stylesheet" type="text/css" HREF="../book.css">
</HEAD>
<BODY BGCOLOR="#ffffff">
<H2 CLASS="Heading2">Text editors and platform text</H2>
<p>The platform text facility is used to implement the default text editor for
the workbench.&nbsp; The interface for text editing is defined in <a href="../reference/api/org/eclipse/ui/texteditor/ITextEditor.html"><b>ITextEditor</b></a>
 as a text specific extension of <a href="../reference/api/org/eclipse/ui/IEditorPart.html"><b>IEditorPart</b></a>.&nbsp;&nbsp;</p>
<p>The implementation of <a href="../reference/api/org/eclipse/ui/texteditor/ITextEditor.html"><b>ITextEditor</b></a>
in the platform is structured in layers.&nbsp; <a href="../reference/api/org/eclipse/ui/texteditor/AbstractTextEditor.html"><b>AbstractTextEditor</b></a>
is the core class of the framework for extending the editor to support source code style
editing of text.&nbsp; This framework is defined in <a href="../reference/api/org/eclipse/ui/texteditor/package-summary.html"><b>org.eclipse.ui.texteditor</b></a>.</p>
<p>The concrete implementation class <a href="../reference/api/org/eclipse/ui/editors/text/TextEditor.html"><b>TextEditor</b></a>
defines the behavior for the standard platform text editor.&nbsp; It is
defined in the package <b><a href="../reference/api/org/eclipse/ui/editors/text/package-summary.html">org.eclipse.ui.editors.text</a></b>.</p>
<p>The text editor framework provides a model-independent editor that
supports the following features:</p>
<ul>
  <li>presentation and user modification of text</li>
  <li>standard text editing operations such as cut/copy/paste, find/replace</li>
  <li>support for context and pulldown menus</li>
  <li>visual presentation of text annotations in rulers or as squigglies in the
    text</li>
  <li>automatic update of annotations as the user edits text</li>
  <li>presentation of additional information such as line numbers</li>
  <li>syntax highlighting</li>
  <li>content assist</li>
  <li>text outlining pages that show the hierarchical structure of the text</li>
  <li>context sensitive behavior</li>
  <li>hover support over rulers and text</li>
  <li>key binding contexts</li>
  <li>preference handling</li>
</ul>
<p>We will explore how these features can be implemented in an editor by
studying the <b>org.eclipse.ui.examples.javaeditor</b>
 example.&nbsp; This example shows how complex features like text coloring, hover help, and
automatic indenting can be implemented.&nbsp; </p>
<p>In discussing these features we will be moving between the abstract
framework, the platform editor <a href="../reference/api/org/eclipse/ui/editors/text/TextEditor.html"><b>TextEditor</b></a>,
and the example's subclass, <b>JavaEditor</b>.</p>

<p>&nbsp;</p>
<p>As an an alternative implementation of a text editor, you can also decide to rely on the <a href="editors_genericeditor.htm"><b>Extensible and Generic Editor</b></a>,
which is a faster and simpler approach tp implement textual language support, but with less control and some limitations compared
to defining a full new editor.

</BODY>
</HTML>
